import { BASE_DIR, ICONS_DIR, ROOT_DIR } from '../helpers.js'import { rollup } from 'rollup'import path from 'path'import nodeResolve from '@rollup/plugin-node-resolve'import babel from '@rollup/plugin-babel'import fs from 'fs-extra'import chalk from 'chalk'const extensions = ['.ts', '.tsx', '.js', '.jsx']// очищаем директорию с компонентамиfs.emptyDirSync(ROOT_DIR + '/dist/icons')const IconsPaths = fs.readdirSync(ICONS_DIR)for (let i = 0; i < IconsPaths.length; i++) {  console.log(chalk.cyanBright(`😀 Building ${IconsPaths[i]}`))  const bundle = await rollup({    input: path.resolve(ROOT_DIR, `src/icons/${IconsPaths[i]}`),    external: ['react', 'react-dom'],    plugins: [      // typescript({ check: false, tsconfigOverride: { compilerOptions: { noEmit: true, declaration: false } }}),      nodeResolve({ extensions }),      babel({        babelHelpers: 'bundled',        extensions: extensions,        presets: ['@babel/preset-react', '@babel/preset-typescript']      })      // terser()    ]  })  const bundledContent = await bundle.generate({    format: 'esm'  })  bundledContent.output.forEach((chunk) => {    if ('code' in chunk) {      fs.writeFileSync(ROOT_DIR + `/dist/icons/${chunk.name}.js`, chunk.code)    }  })  console.log(chalk.green(`✔ ${IconsPaths[i]} generated`))}fs.copyFileSync(  path.resolve(BASE_DIR, 'index.js'),  path.resolve(ROOT_DIR, 'dist/index.js'))fs.copyFileSync(  path.resolve(BASE_DIR, 'index.d.ts'),  path.resolve(ROOT_DIR, 'dist/index.d.ts'))